package com.ijiuchuang.jc_localization.view.adapter;

import android.content.Context;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.support.v4.app.FragmentStatePagerAdapter;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by 王伟 on 2016/6/25
 * Function :
 */
public class TechnologyFragmentPagerAdapter extends FragmentPagerAdapter {

    private List<Fragment> fragments = new ArrayList<>();
    private List<String> nameList = new ArrayList<>();

    public TechnologyFragmentPagerAdapter(FragmentManager fm, List<Fragment> fragments, List<String> nameList) {
        super(fm);
        this.fragments = fragments;
        this.nameList = nameList;
    }

    @Override
    public Fragment getItem(int position) {
        return fragments.get(position);
    }

    @Override
    public int getCount() {
        return fragments.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return nameList.get(position);
    }
}
